#ifndef VECTOR_H
#define VECTOR_H



class Vector
{

public:
    Vector();
    Vector(double vx, double vy, double vz=0.0);
    //Vector(double v[]);
    explicit Vector(bool valid);
    ~Vector();

    void set(double vx, double vy, double vz=0.0);
    void setPolar(double radius, double angle);

    double distanceTo(const Vector& v) const;
    double angle() const;
    double angleTo(const Vector& v) const;
    double magnitude() const;
    Vector lerp(const Vector& v, double t) const;

	bool isInWindow(const Vector& firstCorner, const Vector& secondCorner);

    Vector move(Vector offset);
    Vector rotate(double ang);
    Vector rotate(Vector center, double ang);
    Vector scale(Vector factor);
    Vector scale(Vector center, Vector factor);
	Vector mirror(Vector axisPoint1, Vector axisPoint2);

    Vector operator + (const Vector& v) const;
    Vector operator - (const Vector& v) const;
    Vector operator * (double s) const;
    Vector operator / (double s) const;
    Vector operator - () const;

    void operator += (const Vector& v);
    void operator -= (const Vector& v);
    void operator *= (double s);

    bool operator == (const Vector& v) const;
    bool operator != (const Vector& v) const {
        return !operator==(v);
    }

    static Vector minimum(const Vector& v1, const Vector& v2);
    static Vector maximum(const Vector& v1, const Vector& v2);
    static Vector crossP(const Vector& v1, const Vector& v2);
    static double dotP(const Vector& v1, const Vector& v2);

    friend std::ostream& operator << (std::ostream&, const Vector& v);


public:
    double x;
    double y;
    double z;
    bool valid;
};



#endif //VECTOR_H
